package com.dunka.demo.service;

import com.dunka.demo.mapper.Menu_GrantMapper;
import com.dunka.demo.pojo.Menu_Grant;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author Dunka
 * @Description //TODO
 * @Date 12:25   2019/7/26
 * @ClassName Menu_GrantService
 */
@Service

public class Menu_GrantService {
    @Autowired
    private Menu_GrantMapper menu_grantMapper;

    public List<Integer> getOwnMenu_idByRole_id(int id){
        return menu_grantMapper.getOwnMenu_idByRole_id(id);
    }

    public boolean batchAddMenu_Grant(@Param("menu_idList") List<Integer> menu_idLists, @Param("role_id") int role_id){
        return menu_grantMapper.batchAddMenu_Grant(menu_idLists,role_id);
    }

    public boolean batchDeleteMenu_Grant(@Param("menu_idList") List<Integer> menu_idLists,@Param("role_id") int role_id){
        return menu_grantMapper.batchDeleteMenu_Grant(menu_idLists,role_id);
    }

    public boolean addMenu_Grant(Menu_Grant menu_grant){
        return menu_grantMapper.addMenu_Grant(menu_grant);
    }

    public boolean deleteMenu_Grant(@Param("menu_id") int menu_id, @Param("role_id") int role_id){
        return menu_grantMapper.deleteMenu_Grant(menu_id,role_id);
    }
}
